<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<title>工作台</title>
		<link rel="stylesheet" type="text/css" href="<%=basePath %>css/public.css">
		<link rel="stylesheet" type="text/css" href="<%=basePath %>css/tasks_desktop.css">
		<link rel="stylesheet" type="text/css" href="<%=basePath %>css/tasks_mainAside.css">
	</head>

	<body>
		<div id="mainContent">
			<aside class="l" id="mainAside">
				<jsp:include page="/jsp/basic/desktopAside.jsp"></jsp:include>
			</aside>
			<div class="r" id="mainContent_content">
				<div>
					<div class="width2 l box">
						<h3>待我审批</h3>
						<ul>
							<li>待我操作的采购申请<span class="r"><a onclick="parent.openTabFrame('purchaseRequestApprove','<%=basePath %>audit/listPurchaseRequestAudit.do?status=0');" id="number">${mapzz.applynum}</a>条</span></li>
							<li>待我操作的采购订单<span class="r"><a onclick="parent.openTabFrame('purchaseOrderApprove','<%=basePath %>audit/listPurchaseOrderAudit.do?status=0');" id="purnumber">${mapzz.purchasenum}</a>条</span></li>
							<li>待我操作的退货申请<span class="r"><a onclick="parent.openTabFrame('returnOrderApprove','<%=basePath %>audit/listReturnRequestAudit.do?status=0');" id="renumber">${mapzz.returnRequestAuditOfMe}</a>条</span></li>
						</ul>
					</div>
					<div class="width2 l box">
						<h3>我已审批</h3>
						<ul>
							<li>我已审批的采购申请<span class="r"><a  onclick="parent.openTabFrame('purchaseRequestApprove','<%=basePath %>audit/listPurchaseRequestAudit.do?status=1');" id="gotnumber">${mapzz.passpur}</a>条</span></li>
							<li>我已审批的采购订单<span class="r"><a onclick="parent.openTabFrame('purchaseOrderApprove','<%=basePath %>audit/listPurchaseOrderAudit.do?status=1');" id="gotpurnumber">${mapzz.passodrer}</a>条</span></li>
							<li>我已审批的退货申请<span class="r"><a onclick="parent.openTabFrame('returnOrderApprove','<%=basePath %>audit/listReturnRequestAudit.do?status=1');" id="gotrenumber">${mapzz.passreturn}</a>条</span></li>
						</ul>
					</div>
					<div class="width2 l box">
						<h3>已通过的申请</h3>
						<ul>
							<li>已通过的采购申请<span class="r"><a onclick="parent.openTabFrame('purchaseRequestApprove','<%=basePath %>audit/listPurchaseRequestAudit.do?status=1');" id="notnumber">${mapzz.purnum}</a>条</span></li>
							<li>已通过的采购订单<span class="r"><a onclick="parent.openTabFrame('purchaseOrderApprove','<%=basePath %>audit/listPurchaseOrderAudit.do?status=1');" id="notpurnumber">${mapzz.ordernum}</a>条</span></li>
							<li>已通过的退货申请<span class="r"><a onclick="parent.openTabFrame('returnOrderApprove','<%=basePath %>audit/listReturnRequestAudit.do?status=1');" id="notrenumber">${mapzz.returnnum}</a>条</span></li>
						</ul>
					</div>
					<div class="width2 l box">
						<h3>未通过的申请</h3>
						<ul>
							<li>未通过的采购申请<span class="r"><a onclick="parent.openTabFrame('purchaseRequestApprove','<%=basePath %>audit/listPurchaseRequestAudit.do?status=2');" id="dnotnumber">${mapzz.purnumreject}</a>条</span></li>
							<li>未通过的采购订单<span class="r"><a onclick="parent.openTabFrame('purchaseOrderApprove','<%=basePath %>audit/listPurchaseOrderAudit.do?status=2');" id="dnotpurnumber">${mapzz.ordernumreject}</a>条</span></li>
							<li>未通过的退货申请<span class="r"><a onclick="parent.openTabFrame('returnOrderApprove','<%=basePath %>audit/listReturnRequestAudit.do?status=2');" id="dnotrenumber">${mapzz.returnnumreject}</a>条</span></li>
						</ul>
					</div>

					<c:if test="${isInventoryWarning }">
						<div class="width2 l cb box">
							<h3>库存预警<a class="r" onclick="parent.openTabFrame('inventoryWarning');">详情</a></h3>
							<table>
								<thead>
									<tr>
										<th>物品代码</th>
										<th>物品名称</th>
										<th>物品条码</th>
										<th>预警类型</th>
									</tr>
								</thead>
								<tbody>
									<c:forEach items="${inventoryWarningList }" var="inven" varStatus="ids">
										<tr>
											<td>
												<a>${inven.itemcode }</a>
											</td>
											<td>${inven.chinesename }</td>
											<td>${inven.articlebarcode }</td>
											<td style="color:<c:if test=" ${inven.currentstock>inven.maxstock}">green;</c:if>
					<c:if test="${inven.currentstock<inven.minstock}">red;</c:if>">${inven.currentstock>inven.maxstock?"库存过多":inven.currentstock
					<inven.minstock? "库存不足": "" }</td>
						</tr>
						</c:forEach>
						<c:forEach var="items" begin="${fn:length(inventoryWarningList)+1 }" end="4" step="1">
							<tr>
								<td>&nbsp;</td>
								<td></td>
								<td></td>
								<td></td>
							</tr>
						</c:forEach>
						</tbody>
						</table>
						</div>
						</c:if>

						<c:if test="${isValidityWarning }">
							<div class="width2 l box">
								<h3>有效期预警<a class="r" onclick="parent.openTabFrame('expiryDateWarning');">详情</a></h3>
								<table>
									<thead>
										<tr>
											<th>物品代码</th>
											<th>物品名称</th>
											<th>物品条码</th>
											<th>有效期</th>
										</tr>
									</thead>
									<tbody>
										<c:forEach items="${validityWarningList }" var="inven" varStatus="ids">
											<tr>
												<td>
													<a>${inven.itemcode }</a>
												</td>
												<td>${inven.chinesename }</td>
												<td>${inven.articlebarcode }</td>
												<td>
													<fmt:formatDate value="${inven.expiryDate }" pattern="yyyy-MM-dd" />
												</td>
											</tr>
										</c:forEach>
										<c:forEach var="items" begin="${fn:length(validityWarningList)+1 }" end="4" step="1">
											<tr>
												<td>&nbsp;</td>
												<td></td>
												<td></td>
												<td></td>
											</tr>
										</c:forEach>
									</tbody>
								</table>
							</div>
						</c:if>
				</div>
			</div>
		</div>
	</body>
	<script type="text/javascript" src="<%=basePath %>js/jquery-3.2.1.min.js"></script>
	<script type="text/javascript" src="<%=basePath %>js/public.js"></script>
	<script type="text/javascript" src="<%=basePath %>js/tasks_desktop.js"></script>
	<script type="text/javascript" src="<%=basePath %>js/tasks_mainAside.js"></script>

</html>